<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>

<!-- ========================= -->
<!-- root element: assemblyBuildAcknowledgement -->
<!-- ========================= -->


<xsl:template match="assemblyBuildAcknowledgement">

	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <xsl:variable name="cancelImagePath" select="images//cancelImage"/>
        <xsl:variable name="logoPath" select="images//logo"/>
        <xsl:variable name="bgColor" select="bgColor"/>
        <fo:layout-master-set>
            <fo:simple-page-master master-name="simpleA4"
                page-height="11in"
                page-width="8.5in"
                margin-top="5mm"
                margin-bottom="5mm"
                margin-left="10mm"
                margin-right="10mm" >

                <fo:region-before extent="5mm"/>

                <fo:region-after extent="7mm"/>

                <xsl:if test="@cancel='0'">
                <fo:region-body/>
                </xsl:if>

                <xsl:if test="@cancel='1'">
                <fo:region-body background-image="{$cancelImagePath}" />
                </xsl:if>
            </fo:simple-page-master>
            </fo:layout-master-set>
            <fo:page-sequence master-reference="simpleA4">
            <fo:flow flow-name="xsl-region-body">
                <fo:table table-layout="fixed" width="15%" space-before="1cm" space-after="0.2cm">
                <fo:table-column column-width="5mm"/>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell>
                        <fo:external-graphic src="{$logoPath}" content-height = ".5in"  content-width = ".5in" />
	     	            </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" width="100%" border="1pt double black" space-after="0.5cm">
                    <fo:table-column/>
                    <fo:table-body>
                    <fo:table-row height="0.5cm" background-color="#DEE1E2" border="0.5pt double black">
                        <fo:table-cell hyphenate="true" display-align="center" border="0.5pt double black">
                            <fo:block  text-align="center" font-size="9pt" font-weight="bold">
                                <xsl:value-of select="vendorName"/>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row background-color="#DEE1E2" height="0.5cm" border="0.5pt double black">
                        <fo:table-cell border="0.5pt double black" >
                            <fo:block text-align="center" font-size="9pt" font-weight="bold"><xsl:value-of select="turnKeyLabel"/> Request</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                    <fo:table-column column-width="133mm"/>
                    <fo:table-column column-width="63mm"/>
                    <fo:table-body>
                        <fo:table-row height="0.5cm" border="0.5pt double black">
                            <fo:table-cell number-columns-spanned="2" display-align="center" background-color="#DEE1E2" border="0.5pt double black">
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Customer</fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row>
                            <fo:table-cell border="0.5pt solid black">
                                <fo:table table-layout="fixed" width="100%" margin="1mm">
                                    <fo:table-column column-width="40mm"/>
                                    <fo:table-column column-width="40mm"/>
                                    <fo:table-column column-width="53mm"/>
                                    <fo:table-body>
                                        <fo:table-row height="0.4cm">
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="7pt">Customer name:</fo:block>
                                            </fo:table-cell>
                                            <fo:table-cell number-columns-spanned="2">
                                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                                    <xsl:value-of select="customerName"/>
                                                </fo:block>
                                            </fo:table-cell>
                                        </fo:table-row>
                                        <fo:table-row>
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="internalContactPersonLabel"/>:</fo:block>
                                            </fo:table-cell>
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="7pt" font-weight="bold">Name:</fo:block>
                                            </fo:table-cell>
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Email:</fo:block>
                                            </fo:table-cell>
                                        </fo:table-row>
                                        <xsl:for-each select="/assemblyBuildAcknowledgement/contactPersonList/contactPerson">
                                        <fo:table-row>
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="7pt"></fo:block>
                                            </fo:table-cell>
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="name"/></fo:block>
                                            </fo:table-cell>
                                            <fo:table-cell>
                                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="email"/></fo:block>
                                            </fo:table-cell>
                                        </fo:table-row>
                                        </xsl:for-each>
                                    </fo:table-body>
                                </fo:table>
                            </fo:table-cell>
                            
                            <fo:table-cell>
                                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" background-color="{$bgColor}">
                                <fo:table-column column-width="25mm"/>
                                <fo:table-column column-width="38mm"/>
                                <fo:table-body>
                                    <fo:table-row  height="0.5cm">
                                        <fo:table-cell border="0.5pt double black" border-bottom-style="solid" border-bottom-width="0.5pt" display-align="center" >
                                            <fo:block text-align="left" font-size="7pt"><xsl:value-of select="releaseDateLabel"/>:</fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell  border="0.5pt double black" display-align="center">
                                            <fo:block text-align="left" font-size="7pt">
                                                <xsl:value-of select="assemblyDate"/>
                                            </fo:block>
                                        </fo:table-cell>
                                    </fo:table-row>
                                    <fo:table-row  height="0.5cm" >
                                        <fo:table-cell border="0.5pt double black" display-align="center" >
                                            <fo:block text-align="left" font-size="7pt"><xsl:value-of select="documentedByLabel"/>:</fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell  border="0.5pt double black" display-align="center">
                                            <fo:block text-align="left" font-size="7pt">
                                                <xsl:value-of select="documentedBy"/>
                                            </fo:block>
                                        </fo:table-cell>
                                    </fo:table-row>
                                    <fo:table-row  height="0.5cm" >
                                        <fo:table-cell border="0.5pt double black" display-align="center" >
                                            <fo:block text-align="left" font-size="7pt"><xsl:value-of select="poNumberLabel"/>:</fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell  border="0.5pt double black" display-align="center">
                                            <fo:block text-align="left" font-size="7pt">
                                                <xsl:value-of select="assemblyPONumber"/>
                                            </fo:block>
                                        </fo:table-cell>
                                    </fo:table-row>
                                </fo:table-body>
                                </fo:table>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-body>
                        <fo:table-row height="0.5cm" border="0.5pt double black">
                            <fo:table-cell number-columns-spanned="4" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Identification</fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="releaseNoLabel"/>:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="lotNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Revision No:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="assemblyRevisionNumber"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Request Type:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="productionLot"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="4" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Assembly Info</fo:block>
                            </fo:table-cell>
                    </fo:table-row>
                    <xsl:apply-templates select="assemblyInfo"/>
                    
                        <!--<fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Device PN:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="partNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">

                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Package Type:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="pkgRequested"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Pin Count:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="pinCount"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>

                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Mrkt Part Number:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="mrktPartNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Wafer Size:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="waferSize"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>

                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Assembly Base:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="assemblyBase"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Wafer Map:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="waferMap"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>

                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Assembly Lot No:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="assemblyLotNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Assembly Requested Qty:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="unitQty"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Assembly Spec:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="assemblySpec"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">Assembly Spec Rev No:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="assemblyRev"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>-->
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="assmdiagramOne"/>:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell number-columns-spanned="3" border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                    <xsl:value-of select="assemblySpecFileAttachmentOne"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="50mm"/>
                <fo:table-column column-width="50mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="4" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold"><xsl:value-of select="subConContactInfoHeading"/></fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">Name:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold">Email:</fo:block>
                            </fo:table-cell>
                        </fo:table-row>

                        <xsl:for-each select="/assemblyBuildAcknowledgement/vendorContactPersonList/contactPerson">
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">
                                    <xsl:value-of select="name"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell  border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt">
                                    <xsl:value-of select="email"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        </xsl:for-each>
                    </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="45mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="2" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Assm Special Instructions.</fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell number-columns-spanned="2" border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">
                                    <xsl:value-of select="specialInstructions"/>
                                </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
                </fo:table>
                <xsl:if test="@marking='1'">
                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="50mm"/>
                <!--<fo:table-column column-width="30mm"/>-->
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="3" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold"><xsl:value-of select="markingLabel"/></fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row height="0.4cm">
                        <fo:table-cell border="0.5pt double black" display-align="center" >
                            <fo:block text-align="left" font-size="7pt">First Line:</fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                <xsl:value-of select="markingFirstLine"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:external-graphic src="{$logoPath}" content-height=".3in"  content-width=".3in" />
                        </fo:table-cell>
                     </fo:table-row>
                    <fo:table-row height="0.4cm">
                        <fo:table-cell border="0.5pt double black" display-align="center" >
                            <fo:block text-align="left" font-size="7pt">Second Line:</fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                <xsl:value-of select="markingSecondLine"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                        </fo:table-cell>

                    </fo:table-row>
                    <fo:table-row height="0.4cm">
                        <fo:table-cell border="0.5pt double black" display-align="center" >
                            <fo:block text-align="left" font-size="7pt">Third Line:</fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                <xsl:value-of select="markingThirdLine"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row height="0.4cm">
                        <fo:table-cell border="0.5pt double black" display-align="center" >
                            <fo:block text-align="left" font-size="7pt">Fourth Line:</fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                <xsl:value-of select="markingFourthLine"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row height="0.4cm">
                        <fo:table-cell border="0.5pt double black" display-align="center" >
                            <fo:block text-align="left" font-size="7pt">Fifth Line:</fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                <xsl:value-of select="markingFifthLine"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row height="0.4cm">
                        <fo:table-cell border="0.5pt double black" display-align="center" >
                            <fo:block text-align="left" font-size="7pt">Sixth Line:</fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                <xsl:value-of select="markingSixthLine"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  border="0.5pt double black" display-align="center">
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
                </fo:table>
                </xsl:if>
                <!--****************************************************************************************************************************************************************-->
                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="20mm"/>
                <xsl:if test="/assemblyBuildAcknowledgement/showDiebankLotNumber = 'true'">
                <fo:table-column column-width="22mm"/>
                </xsl:if>
                <fo:table-column column-width="22mm"/>
                <fo:table-column column-width="35mm"/>
                <fo:table-column column-width="15mm"/>
                <fo:table-column column-width="10mm"/>
                <fo:table-column column-width="10mm"/>
                <fo:table-column column-width="10mm"/>
                <fo:table-column column-width="10mm"/>
                <fo:table-column column-width="12mm"/>
                <fo:table-body>
                    <fo:table-row height="0.4cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="10" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="left" font-size="8pt" font-weight="bold">Wafer Information</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row height="0.4cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="10" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="left" font-size="8pt" font-weight="bold">Lot Information</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row height="0.4cm" border="0.5pt double black">
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt"><xsl:value-of select="partNoLabel"/></fo:block>
                        </fo:table-cell>
			            <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Fab Lot No</fo:block>
                        </fo:table-cell>
                        <xsl:if test="/assemblyBuildAcknowledgement/showDiebankLotNumber = 'true'">
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Die Bank Lot#</fo:block>
                        </fo:table-cell>
                        </xsl:if>
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt"><xsl:value-of select="shippedLotNoLabel"/></fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Wafer #</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Good Die</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Qty Pulled</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Build Qty</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Die Bank Location</fo:block>
                        </fo:table-cell>
                        <xsl:if test="/assemblyBuildAcknowledgement/showScreenPrintOrder = 'true'">
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Screen Print Order</fo:block>
                        </fo:table-cell>
                        </xsl:if>
                        <xsl:if test="/assemblyBuildAcknowledgement/showBackGrindOrder = 'true'">
                        <fo:table-cell display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                            <fo:block text-align="center" font-size="7pt">Back Grind Order</fo:block>
                        </fo:table-cell>
                        </xsl:if>

                    </fo:table-row>
                    <xsl:for-each select="/assemblyBuildAcknowledgement/lotDetails/lotData">
                        <fo:table-row height="0.4cm" border="0.5pt double black">
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="device"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="fabLotNumber"/></fo:block>
                            </fo:table-cell>
                            <xsl:if test="/assemblyBuildAcknowledgement/showDiebankLotNumber = 'true'">
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="lotNumber"/></fo:block>
                            </fo:table-cell>
                            </xsl:if>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="shippedLotNumber"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell hyphenate="true" language="en" display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="waferNumber"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="qtyAvailable"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="qtyPulled"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="qtyBuild"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="dbLocation"/></fo:block>
                            </fo:table-cell>
                            <xsl:if test="/assemblyBuildAcknowledgement/showScreenPrintOrder = 'true'">
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="screenPrintOrder"/></fo:block>
                            </fo:table-cell>
                            </xsl:if>
                            <xsl:if test="/assemblyBuildAcknowledgement/showBackGrindOrder = 'true'">
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="backGrindOrder"/></fo:block>
                            </fo:table-cell>
                            </xsl:if>
                        </fo:table-row>
                    </xsl:for-each>
                    <fo:table-row height="0.4cm" border="0.5pt double black">
                            <fo:table-cell display-align="center" >
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" >
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <xsl:if test="/assemblyBuildAcknowledgement/showDiebankLotNumber = 'true'">
                            <fo:table-cell display-align="center" >
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            </xsl:if>
                            <fo:table-cell display-align="center" >
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" >
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" >
                                <fo:block text-align="center" font-size="7pt">Total Qty</fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="unitQty"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center" border="0.5pt double black"   >
                                <fo:block text-align="center" font-size="7pt"><xsl:value-of select="totalbuildQty"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center">
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                            </fo:table-cell>
                            <xsl:if test="/assemblyBuildAcknowledgement/showScreenPrintOrder = 'true'">
                                <fo:table-cell display-align="center">
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                                </fo:table-cell>
                            </xsl:if>
                            <xsl:if test="/assemblyBuildAcknowledgement/showBackGrindOrder = 'true'">
                                <fo:table-cell display-align="center">
                                <fo:block text-align="center" font-size="7pt"></fo:block>
                                </fo:table-cell>
                            </xsl:if>
                        </fo:table-row>
                        <xsl:if test="/assemblyBuildAcknowledgement/isBomLotAvailable = 'true'">
                            <fo:table-row height="0.4cm" border="0.5pt double black">
                                <fo:table-cell number-columns-spanned="2" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                    <fo:block text-align="left" font-size="8pt" font-weight="bold"><xsl:value-of select="bomLotNoLabel"/> Lot Information</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row height="0.4cm" border="0.5pt double black">
                                <fo:table-cell display-align="center" border="0.5pt double black"  number-columns-spanned="2"  background-color="#DEE1E2">
                                    <fo:block text-align="center" font-size="7pt"><xsl:value-of select="bomLotNoLabel"/> Part Number</fo:block>
                                </fo:table-cell>
                                <fo:table-cell display-align="center" border="0.5pt double black"   background-color="#DEE1E2">
                                    <fo:block text-align="center" font-size="7pt">Lot Number</fo:block>
                                </fo:table-cell>
                                <xsl:if test="/assemblyBuildAcknowledgement/isBomPullingByWaferId = 'true'">
                                    <fo:table-cell display-align="center" border="0.5pt double black"   background-color="#DEE1E2">
                                        <fo:block text-align="center" font-size="7pt">Wafer #</fo:block>
                                    </fo:table-cell>
                                </xsl:if>
                                <fo:table-cell display-align="center" border="0.5pt double black"   background-color="#DEE1E2">
                                    <fo:block text-align="center" font-size="7pt">Total Die</fo:block>
                                </fo:table-cell>
                                <fo:table-cell display-align="center" border="0.5pt double black"   background-color="#DEE1E2">
                                    <fo:block text-align="center" font-size="7pt">Use Die</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <xsl:for-each select="/assemblyBuildAcknowledgement/bomLotDetails/bomLotData">
                                <fo:table-row height="0.5cm" border="0.5pt double black">
                                <fo:table-cell display-align="center" border="0.5pt double black"  number-columns-spanned="2">
                                        <fo:block text-align="center" font-size="7pt"><xsl:value-of select="bomPartNumber"/></fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell display-align="center" border="0.5pt double black">
                                        <fo:block text-align="center" font-size="7pt"><xsl:value-of select="bomLotNumber"/></fo:block>
                                    </fo:table-cell>
                                    <xsl:if test="/assemblyBuildAcknowledgement/isBomPullingByWaferId = 'true'">
                                        <fo:table-cell display-align="center" border="0.5pt double black">
                                            <fo:block text-align="center" font-size="7pt"><xsl:value-of select="bomWaferId"/></fo:block>
                                        </fo:table-cell>
                                    </xsl:if>
                                    <fo:table-cell display-align="center" border="0.5pt double black">
                                        <fo:block text-align="center" font-size="7pt"><xsl:value-of select="totalBomQty"/></fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell display-align="center" border="0.5pt double black">
                                        <fo:block text-align="center" font-size="7pt"><xsl:value-of select="bomQtyPulled"/></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </xsl:for-each>
                        </xsl:if>
                    </fo:table-body>
                </fo:table>
                <xsl:if test="/assemblyBuildAcknowledgement/showTestInformation = 'true'">
                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="40mm"/>
                <fo:table-column column-width="25mm"/>
                <fo:table-column column-width="40mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="4" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Test</fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt" >Test Location :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold"><xsl:value-of select="testLocation"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" >Test PO # :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt" font-weight="bold"><xsl:value-of select="testPO"/></fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center"  >
                                <fo:block text-align="left" font-size="7pt" >Test Spec :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center"  font-weight="bold">
                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="testSpec"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt" >Test Spec Rev :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" font-weight="bold">
                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="testRevision"/></fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <!--<fo:table-row  height="0.5cm" >
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt" >Test Program Name :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" font-weight="bold">
                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="testProgName"/></fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt" >Test Program Revision Number :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center" font-weight="bold">
                                <fo:block text-align="left" font-size="7pt"><xsl:value-of select="testProgNameRev"/></fo:block>
                            </fo:table-cell>
                        </fo:table-row>-->
                </fo:table-body>
                </fo:table>

                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="45mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="2" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Test Special Instructions.</fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell number-columns-spanned="2" border="0.5pt double black" display-align="center" >
                                <fo:block text-align="left" font-size="7pt">
                                    <xsl:value-of select="testSpecialInstructions"/>
                                </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
                </fo:table>
                </xsl:if>

                <xsl:if test="/assemblyBuildAcknowledgement/isReelQtyAvailable = 'true'">
                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="45mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                            <fo:table-cell border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">Reel Qty:</fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.5pt double black" display-align="center">
                                <fo:block text-align="left" font-size="7pt">
                                    <xsl:value-of select="reelQty"/>
                                </fo:block>
                            </fo:table-cell>
                    </fo:table-row>
                    </fo:table-body>
                </fo:table>
                </xsl:if>



                <fo:table table-layout="fixed" margin="1mm" number-columns-spanned="2" width="100%" space-after="0.5cm" border="1pt double black" background-color="{$bgColor}">
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="40mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="35mm"/>
                <fo:table-body>
                    <fo:table-row height="0.5cm" border="0.5pt double black">
                        <fo:table-cell number-columns-spanned="4" display-align="center" border="0.5pt double black"  background-color="#DEE1E2" >
                                <fo:block text-align="left" font-size="8pt" font-weight="bold">
                                    <!--Shipping Requirements-->
                                    <xsl:value-of select="shippingLabel"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row  height="0.5cm" >
                            <fo:table-cell  display-align="center" >
                                    <fo:block text-align="left" font-size="7pt" >Address :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell  display-align="center" >
                                <fo:block text-align="left" font-size="7pt">
                                    <fo:block font-size="7pt" font-weight="bold" > <xsl:apply-templates select="shippingAddress"/> </fo:block>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell  display-align="center" >
                                <fo:block text-align="left" font-size="7pt" >Send Ship Alerts To :</fo:block>
                            </fo:table-cell>
                            <fo:table-cell display-align="center"  >
                                <xsl:for-each select="/assemblyBuildAcknowledgement/shipAlerts/shipAlert">
                                    <fo:block text-align="left" font-size="7pt" font-weight="bold">
                                        <xsl:value-of select="email"/>
                                    </fo:block>
                                </xsl:for-each>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:flow>
        </fo:page-sequence>
    </fo:root>
</xsl:template>

<xsl:template match="shippingAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell display-align="center">
				<fo:block><xsl:value-of select="contactPerson"/></fo:block>
				<fo:block><xsl:value-of select="address1"/></fo:block>
				<fo:block><xsl:value-of select="address2"/></fo:block>
				<fo:block><xsl:value-of select="address3"/></fo:block>
				<fo:block><xsl:value-of select="address4"/></fo:block>
                <fo:block><xsl:value-of select="city"/></fo:block>
                <fo:block><xsl:value-of select="state"/></fo:block>
				<fo:block><xsl:value-of select="phone"/></fo:block>
				<fo:block><xsl:value-of select="fax"/></fo:block>
                <fo:block><xsl:value-of select="cellno"/></fo:block>
                <fo:block><xsl:value-of select="email"/></fo:block>
				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
</xsl:template>
<xsl:template match="assemblyInfo">
    <xsl:call-template name="FourColumnTemplate"/>
</xsl:template>
<xsl:template name="FourColumnTemplate">
    <xsl:for-each select="row">
    <fo:table-row  height="0.5cm" >
        <fo:table-cell border="0.5pt double black" display-align="center" >
            <fo:block text-align="left" font-size="7pt">
                <xsl:if test="col1 != '' ">
                    <xsl:value-of select="col1"/>:
                </xsl:if>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell  border="0.5pt double black" display-align="center">
            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                <xsl:value-of select="col2"/>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell border="0.5pt double black" display-align="center" >
            <fo:block text-align="left" font-size="7pt">
                <xsl:if test="col3 != '' ">
                    <xsl:value-of select="col3"/>:
                </xsl:if>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell  border="0.5pt double black" display-align="center">
            <fo:block text-align="left" font-size="7pt" font-weight="bold">
                <xsl:value-of select="col4"/>
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
    </xsl:for-each>
</xsl:template>
</xsl:stylesheet>



